//
//  AXHomeNcpsceScondCell.m
//  AnXin100
//
//  Created by 天质弘耕 on 2018/10/22.
//  Copyright © 2018年 tzhg. All rights reserved.
//

#import "AXHomeNcpsceScondCell.h"


@implementation AXHomeNcpsceScondCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
       
        [self creatView];
        [self setlayout];
    }
    return self;
}

- (void)creatView {
    
    self.leftImgView = [[UIImageView alloc]init];
    self.leftImgView.userInteractionEnabled = YES;
    self.leftImgView.contentMode =UIViewContentModeScaleAspectFill;
    self.leftImgView.clipsToBounds=YES;//
    self.leftImgView .image = [UIImage imageNamed:@"cxth"];
    [self.contentView addSubview:self.leftImgView ];
    
    UITapGestureRecognizer *leftTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(leftTap:)];
    [self.leftImgView addGestureRecognizer:leftTap];
    
    
    self.rightImgView = [[UIImageView alloc]init];
    self.rightImgView.userInteractionEnabled = YES;
    self.rightImgView .contentMode =UIViewContentModeScaleAspectFill;
    self.rightImgView .clipsToBounds=YES;//
    self.rightImgView  .image = [UIImage imageNamed:@"hdzq"];
    [self.contentView addSubview:self.rightImgView  ];
    
    UITapGestureRecognizer *rightTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(rightTap:)];
    [self.rightImgView  addGestureRecognizer:rightTap];

}

- (void)setlayout {
    
    self.leftImgView.sd_layout
    .leftSpaceToView(self.contentView, 10)
    .topSpaceToView(self.contentView, 0)
    .widthIs((SCREEN_WIDTH-30)/3*2)
    .heightIs(93);
    
    self.rightImgView.sd_layout
    .rightSpaceToView(self.contentView, 10)
    .topSpaceToView(self.contentView, 0)
    .widthIs((SCREEN_WIDTH-30)/3)
    .heightIs(93);
    
    
    
}


#pragma mark - action

- (void)leftTap:(UITapGestureRecognizer *)tap {
    
    if (self.tapButtonClickedBlock) {
        
        self.tapButtonClickedBlock(tap.view.tag);
    }
}

- (void)rightTap:(UITapGestureRecognizer *)tap {
    
    if (self.tapButtonClickedBlock) {
        
        self.tapButtonClickedBlock(tap.view.tag);
    }
}

@end
